﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AvalonDock;
using System.Windows;
using System.Windows.Controls;
using WpfRcp.Controls;

namespace AvalonDockControls.Controls
{
    public class DockableContentTabMenuItem : DockableContent, ITabMenuItem
    {
        public static readonly RoutedEvent DetachEvent = EventManager.RegisterRoutedEvent("Detach", RoutingStrategy.Bubble,
                                                                                          typeof(RoutedEventHandler), typeof(DockableContentTabMenuItem));
        public static readonly RoutedEvent CloseEvent = EventManager.RegisterRoutedEvent("Close", RoutingStrategy.Bubble,
                                                                                 typeof(RoutedEventHandler), typeof(DockableContentTabMenuItem));

        public event RoutedEventHandler Detach
        {
            add { AddHandler(DetachEvent, value); }
            remove { RemoveHandler(DetachEvent, value); }
        }

        public new event RoutedEventHandler Close
        {
            add { AddHandler(CloseEvent, value); }
            remove { RemoveHandler(CloseEvent, value); }
        }

        public DependencyProperty HeaderTitleProperty
        {
            get { return ManagedContent.TitleProperty; }
        }

    }
}
